<!-- 话题内容 空白页 -->
<!Doctype html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />



<title th:if="topic != null" th:text="${topic.title}"></title>
<!--<link rel="shortcut icon" type="image/x-icon" href="${baseURL}${commonPath}images/favicon.ico'}" media="screen" />-->
<link th:href="@{'/static/css/common.css?12dd'}" rel="stylesheet" type="text/css" />
<link th:href="@{'/static/css/themify-icons/style.css'}" type="text/css" rel="stylesheet">
<!--[if (IE 6)|(IE 7)|(IE 8)]>
<script type="text/javascript" th:src="@{'/static/js/css3pie/PIE_IE678.js'}"></script>
<![endif]-->
<script type="text/javascript" th:src="@{'/static/js/tool.js'}" language="javascript"></script>
<script type="text/javascript" th:src="@{'/static/js/ajax.js'}" language="javascript" ></script>
<script type="text/javascript" th:src="@{'/static/js/json2.js'}" language="javascript" ></script>
<script type="text/javascript" th:src="@{'/static/js/jquery/jquery.min.js'}" language="javascript"></script>
<script type="text/javascript" th:src="@{'/static/js/DPlayer/hls.min.js'}" language="javascript"></script>
<script type="text/javascript" th:src="@{'/static/js/DPlayer/DPlayer.min.js'}" language="javascript"></script>


<script type="text/javascript" th:src="@{'/static/js/jquery/jquery.letterAvatar.js'}" language="javascript"></script>
<script type="text/javascript" th:src="@{'/static/js/kindeditor/kindeditor-min.js'}" language="javascript"></script>
<link th:href="@{'/static/js/layer/skin/default/layer.css'}"  type="text/css" rel="stylesheet"/>
<script type="text/javascript" th:src="@{'/static/js/layer/layer.js'}" language="javascript"></script>

<link th:href="@{'/static/js/simplebox/css/simplebox.css'}"  type="text/css" rel="stylesheet"/>
<script type="text/javascript" th:src="@{'/static/js/simplebox/js/simplebox.js'}" language="javascript"></script>

<link th:href="@{'/static/js/prism/default-block/prism.css'}"  type="text/css" rel="stylesheet"/>
<script type="text/javascript" th:src="@{'/static/js/prism/default-block/prism.js'}" language="javascript"></script>
<script type="text/javascript" th:src="@{'/static/js/prism/default-block/clipboard.min.js'}" language="javascript"></script>


<!--[if (IE 6)|(IE 7)|(IE 8)]>
<script type="text/javascript">
	//让ie6/ie7/ie8支持自定义标签。这段代码必须放在页面头部<head>标签内
	(function() {
		var a = ['hide'/* 其他HTML5元素 */];
		for (var i = 0, j = a.length; i < j; i++) {
			document.createElement(a[i]);
		}	
	})();
</script>
<![endif]-->

</head>
<body>
<!-- 引入页头 -->
<div th:include="public/newPublic_2"></div>
<div class="skeleton">
	<div class="main wrap" >
		<div class="topicContentModule" th:if="topic != null">
	        <div class="left">
	        	<div class="topic-wrap">
			        <div class="topicTag">
						<a th:href="'index?tagId='+${topic.tagId}" class="tag" th:text="${topic.tagName}"></a>
					</div>

						<div class="editTopic" th:if="topic.userName == systemUser.userName" >
							<a href="user/editTopic?topicId=${topic.id}" ><i class="cms-pencil-alt" ></i>编辑</a>
						</div>

		        	<div class="topicBox">
		                <div class="title">[[${topic.title}]]</div>
		                <div class="topicInfo clearfix" >
		                	<div class="postTime" th:text="${#dates.format(topic.createTime,'yyyy-MM-dd HH:mm:ss')}"></div>
		                	<div class="viewTotal-icon"><i class="cms-view"></i></div>
		                	<div class="viewTotal" th:text="${topic.viewNum}+'次阅读'"></div>
		                	<div class="comment-icon"><i class="cms-commentCount"></i></div>
		                	<div class="comment" th:text="${topic.commentNum}+'个评论'"></div>
		                </div>
		                <!-- topicId属性用来支持JS获取隐藏内容 -->
						<div class="topicContent" th:topicId="${topic.id}">
							<th:block th:utext="${topic.content}"></th:block>
						</div>
						
						<div class="favorite-formModule">
							<!--加入收藏夹-->
							<th:block th:include="forum/favoriteRelated_addFavorite_collection_default"></th:block>
							<th:block th:include="forum/likeRelated_addLike_collection_default"></th:block>


						</div>
					</div>
				</div>

				<!-- 引入评论列表 -->
				<div th:include="forum/topicRelated_comment_page"></div>


<!--				<#if topic.allow == true><#&#45;&#45; 允许评论 &ndash;&gt;-->
<!--					<#&#45;&#45; 引入添加评论 &ndash;&gt;-->
                <div th:include="forum/topicRelated_addComment"></div>
<!--				<#else><#&#45;&#45; 不允许评论 &ndash;&gt;-->
<!--					<div class="addCommentModule" >-->
<!--						<div class="respond">-->
<!--							<p style="font-size:13px;padding:8px;text-align:center;background:#eee;overflow:hidden">-->
<!--								评论已关闭-->
<!--							</p>-->
<!--						</div>-->
<!--					</div>-->
<!--				</#if>-->
				


				</th:block>
				
			</div>
			
			<div class="right">
				<div class="userInfo-wrap clearfix">
					<div class="userInfo">
						<div class="author">
				            <a th:href="@{'/user/control/home?userName='+${topic.username}}" >
								<img th:if="${topic.avatarName != null}" th:src="@{'/readImg'+${topic.avatarName}}">

								<img th:if="${topic.avatarName == null}" th:src="@{'/static/images/min_avata.png'}"/>
							</a>
						</div>
						<p class="name">
							<a th:href="@{'/user/control/home?userName='+${topic.username}}" target="_blank" th:if="${topic.username!=null}" th:text="${topic.nikename}">
							</a>
						</p>
<!--						<#if topic.isStaff>-->
<!--							<div class="role">-->
<!--								<i class="staff">官方人员</i>	-->
<!--							</div>-->
<!--						</#if>-->
						<ul>
			            	<li>
			                	<span id="answerCount" >0</span>
			                    <span>回答</span>
			                </li>
			                <li>
			                    <span id="followerCount">0</span>
			                    <span>粉丝</span>
			                </li>
			                <li>
			                    <span id="followCount">0</span>
			                    <span>关注</span>
			             	</li>
			             	<input type="hidden" id="_userName" th:value="${topic.username}"/>
			             	
			             	<script language="javascript" type="text/javascript">
								//查询回答总数
								function queryAnswerCount(){
									//获取用户名称
									var userName = document.getElementById("_userName").value;
									get_request(function(value){
										if(value != ""){
											var data = JSON.parse(value);
									        document.getElementById("answerCount").innerHTML = data;
								        }
									},
										"queryAnswerCount.htm?userName="+userName, true);
								}
								queryAnswerCount();
								
								//查询粉丝总数
								function queryFollowerCount(){
									//获取用户名称
									var userName = document.getElementById("_userName").value;
									get_request(function(value){
										if(value != ""){
											var data = JSON.parse(value);
									        document.getElementById("followerCount").innerHTML = data;
								        }
									},
										"queryFaceCount?username="+userName, true);
								}
								queryFollowerCount();
								
								
								//查询关注总数
								function queryFollowCount(){
									//获取用户名称
									var userName = document.getElementById("_userName").value;
									get_request(function(value){
										if(value != ""){
											var data = JSON.parse(value);
									        document.getElementById("followCount").innerHTML = data;
								        }
									},
										"queryFocusCount?username="+userName, true);
								}
								queryFollowCount();
							</script>
			             	

			             	
						</ul>

							<div class="action-button">
								<!-- 引入关注用户 -->

								<div th:include="forum/followRelated_addFollow_collection_default"></div>

							</div>

					</div>
				</div>
<!--				-->
<!--				<#&#45;&#45; 引入相似问题 &ndash;&gt;-->
<!--				<@include action="${topicRelated_likeTopic_1}" topicId="${topic.id}"/>-->
				
			</div>
		</div>

	</div>
</div>
<!-- 引入页脚 -->
<div th:include="public/newPublic_3"></div>
</body>

<!-- 代码高亮显示 -->
<script type="text/javascript">
	//代码语言类
	function languageClassName(originalClass, newClass) {
		var o = new Object()
		o.originalClass = originalClass;//原始样式标签名称
		o.newClass = newClass;//新样式标签名称
		return o;
	}

	$(document).ready(function(){
	    //代码语言映射集合
	    var languageMapping_arr = new Array();
		var languageClassName_xml = languageClassName("lang-xml","language-xml");
	    languageMapping_arr.push(languageClassName_xml);
	    var languageClassName_css = languageClassName("lang-css","language-css");
	    languageMapping_arr.push(languageClassName_css);
	    var languageClassName_html = languageClassName("lang-html","language-html");
	    languageMapping_arr.push(languageClassName_html);
	    var languageClassName_js = languageClassName("lang-js","language-JavaScript");
	    languageMapping_arr.push(languageClassName_js);
	    var languageClassName_java = languageClassName("lang-java","language-java");
	    languageMapping_arr.push(languageClassName_java);
	    var languageClassName_pl = languageClassName("lang-pl","language-perl");
	    languageMapping_arr.push(languageClassName_pl);
	    var languageClassName_py = languageClassName("lang-py","language-python");
	    languageMapping_arr.push(languageClassName_py);
	    var languageClassName_rb = languageClassName("lang-rb","language-ruby");
	    languageMapping_arr.push(languageClassName_rb);
	    var languageClassName_vb = languageClassName("lang-vb","language-VB.Net");
	    languageMapping_arr.push(languageClassName_vb);  
	    var languageClassName_cpp = languageClassName("lang-cpp","language-C++");
	    languageMapping_arr.push(languageClassName_cpp);  
	    var languageClassName_cs = languageClassName("lang-cs","language-C#");
	    languageMapping_arr.push(languageClassName_cs);  
	    var languageClassName_bsh = languageClassName("lang-bsh","language-Bash + Shell");
	    languageMapping_arr.push(languageClassName_bsh);  
	      
	    
	    var doc_pre = $(".topicContent,.commentContent").find('pre[class^="prettyprint"]');
	    doc_pre.each(function(){
	        var class_val = $(this).attr('class');
	      	var lan_class = "";
	        var class_arr = new Array();
	        class_arr = class_val.split(' ');
	        for(var i=0; i<class_arr.length; i++){
	        	var className = $.trim(class_arr[i]);
	        	
	        	if(className != null && className != ""){
	        		if (className.lastIndexOf('lang-', 0) === 0) {
	        			lan_class = className;
			            break;
			        }
	        	}	
	        }
	        
	        for(var i=0; i<languageMapping_arr.length; i++){
		    	var languageMapping = languageMapping_arr[i];
		    	if(languageMapping.originalClass == lan_class){
			    	var pre_content = '<code>'+$(this).html()+'</code>';
			        $(this).html(pre_content);
			        $(this).attr("class",'line-numbers '+languageMapping.newClass);
		    	}
		    }
		    if(lan_class == ""){
		    	var pre_content = '<code>'+$(this).html()+'</code>';
			    $(this).html(pre_content);
			    $(this).attr("class",'line-numbers language-markup');
		    }
	    });
	});
</script>




<script type="text/javascript">
// 获取随机数
function getRandom(m) {
	//生成的随机数截取m位，生成的随机数最大不超过13位，能保证首位不为0
    m = m > 13 ? 13 : m;
   	var num = Math.random().toString();
   	if(num.substr(num.length - m, 1) === '0') {           
   		return getRandom(m);
   	}
	return num.substring(num.length - m);
}
//设置播放器标签
function setPlayerTag(){
	//获取<player>标签属性
	$(".topicContent").find("player").each(function(){
		var random = getRandom(13);

		var id = "player_"+random;
		var url = $(this).attr("url");
		var cover = $(this).attr("cover");//封面
		var thumbnail = $(this).attr("thumbnail");//缩略图
		//设置Id
		$(this).attr("id",id);
		
		if(url == ""){//如果视频处理中
			var dp = new DPlayer({
         		container: document.getElementById(id),//播放器容器元素
         		screenshot: false,//开启截图，如果开启，视频和视频封面需要开启跨域
         		video: {
         			    
         		}
         	});
			insertProcess(id);
		}else{
			if(cover != undefined && cover != "" && thumbnail != undefined && thumbnail != ""){//切片视频
				var dp = new DPlayer({
					container: document.getElementById(id),//播放器容器元素
					screenshot: false,//开启截图，如果开启，视频和视频封面需要开启跨域
					hotkey: true,
					video: {
					    url: url,
					    type: 'hls',
					    pic: cover,//视频封面
					    thumbnails: thumbnail//视频预览图
					}
				});
			}else{
				var dp = new DPlayer({
           			container: document.getElementById(id),//播放器容器元素
           			screenshot: false,//开启截图，如果开启，视频和视频封面需要开启跨域
           			
           			video: {
           			    url: url
           			}
           		});
			
			}
			
			
		}
		
	})

}
//插入处理提示层
function insertProcess(id){
	$("#"+id).prepend("<div class='dplayer-process'><div class='box'><div class='prompt'>视频处理中，请稍后再刷新</div></div></div>");
}
$(document).ready(function(){
	setPlayerTag();
});
</script>



<!-- 图片点击放大 -->
<script type="text/javascript">
	$(function () {
		//图片不含宽度的元素,因为svg表情不放大，svg表情后端默认设置了宽度
    	$(".topicContent img:not([width]),.commentContent img:not([width])").simplebox();
    	
    //	$(".topicContent img,.commentContent img").simplebox();
	});
</script>


</html>
